<script type="text/javascript">
$(document).ready(function() { 
	ajaxLink();
}); 
</script>
<div class="content">
	<div class="simplebox grid740">
	<form action="{url('Ad','Index')}" method="post">
	<select name="template">
	{loop $templates $item}
	<option value="{$item}" {if $t==$item}selected{/if}>{$item}</option>
	{/loop}
	</select>
	<input type="submit" value="搜索广告" />
	</form>
	<br />
	<div class="titleh">
    <h3>广告管理  [<a href="{url('Ad','Edit',array('template'=>$t))}">添加广告</a>]  [<a href="{url('Ad','Position',array('template'=>$t))}">广告位管理</a>]</h3>
    </div>
        <table class="tablesorter"> 
        	<thead> 
        		<tr> 
        			<th class="header">ID</th> 
        			<th class="header">广告名称</th> 
        			<th class="header">所在模板</th>
        			<th class="header">广告位置</th> 
        			<th class="header">排序</th> 
        			<th class="header">操作</th> 
        		</tr> 
        	</thead> 
            
            <tbody>
        		{if !empty($ads)}
            	{loop $ads $item}
            	<tr> 
            		<td>{$item['id']}</td> 
            		<td>{$item['name']}</td> 
            		<td>{$item['template']}</td> 
            		<td>{$item['position']}</td> 
            		<td>{$item['orderby']}</td> 
            		<td><a href="{url('Ad','Edit',array('id'=>$item['id']))}">编辑</a> <a href="{url('Ad','Del',array('id'=>$item['id']))}" type="ajaxGet" confirm="确定要删除么？">删除</a></td> 
            	</tr> 
            	{/loop}
            	{/if}
            </tbody> 
            
        </table>
	</div>
</div>